<template>
  <form-item>
    <el-form-item label="是否禁用">
      <el-switch v-model="options.disabled"> </el-switch>
    </el-form-item>
    <el-form-item label="占位符">
      <el-input v-model="options.placeholder"> </el-input>
    </el-form-item>
    <div>插槽、选项</div>
    <div class="p1">
      <el-form-item label-width="0">
        <options-component
          type="选项"
          :options.sync="slot.options"
          @add="() => add('__slot__', 'options')"
          @remove="(index) => remove(index, '__slot__', 'options')"
        ></options-component>
      </el-form-item>
    </div>
  </form-item>
</template>

<script>
import common from '../mixin';
export default {
  name: 'SelectTool',
  mixins: [common],
  computed: {
    vModel: {
      get() {
        return this.component['__vModel__'].toString();
      },
      set(val) {
        this.setComponent({
          ...this.component,
          __vModel__: val.split(',')
        });
      }
    }
  }
};
</script>
